package com.ccb.sc.common.modules.groupon.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ccb.sc.common.entity.BaseEntity;
import com.ccb.sc.common.modules.groupon.enums.GrouponStatus;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 团购成团记录
 * </p>
 *
 * @author ken
 * @since 2025-02-15
 */
@Getter
@Setter
@TableName("tb_groupon_log")
public class GrouponLog extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 会员id
     */
    @TableField("member_id")
    private Long memberId;

    /**
     * 分享人id
     */
    @TableField("invite_id")
    private Long inviteId;

    /**
     * 订单id
     */
    @TableField("order_id")
    private String orderId;

    /**
     * 团购id
     */
    @TableField("groupon_id")
    private Long grouponId;

    /**
     * 当前团购id
     */
    @TableField("groupon_uuid")
    private String grouponUuid;

    /**
     * 商品id
     */
    @TableField("goods_id")
    private Long goodsId;

    /**
     * 商品规格id
     */
    @TableField("goods_spec_id")
    private Long goodsSpecId;

    /**
     * 团购价格
     */
    @TableField("groupon_price")
    private BigDecimal grouponPrice;

    /**
     * 开始时间
     */
    @TableField("start_time")
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @TableField("end_time")
    private LocalDateTime endTime;

    /**
     * 退还状态：0未退还 1已退还
     */
    @TableField("is_refund")
    private Integer isRefund;

    /**
     * 成团状态：0拼团中 1拼团失败 2已结束
     */
    @TableField("status")
    private GrouponStatus status;


}
